﻿<Window x:Class="CollectionCreator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="CollectionCreator" Height="768" Width="1032" MinHeight="768" MinWidth="1032">
    <Grid>

        <Menu Height="22" VerticalAlignment="Top" IsMainMenu="True" Background="White">

            <MenuItem Header="_File">
                <MenuItem Header="_Exit" Click="Exit"/>
            </MenuItem>

            <MenuItem Header="_About" Click="ShowAbout">
            </MenuItem>
        </Menu>


        <DockPanel Height="22" VerticalAlignment="Top" Background="{x:Null}" HorizontalAlignment="Right" >
            <Label Height="20" Content="Server:" Padding="0,0,0,0" Margin="0,1" Width="46"/>
            <TextBox x:Name="CMServer" Width="160" Height="20" Padding="0" Margin="0,1"/>
            <Label Height="20" Content=" Username:" Padding="0" Margin="0,1" Width="61" />
            <TextBox x:Name="CMUser" Width="134" Height="20" Padding="0" Margin="0,1" />
            <Label Content=" Password:" Height="20" Padding="0" Margin="0,1" Width="61" />
            <TextBox x:Name="CMPass" Width="176" Height="20" Padding="0" Margin="0,1"/>
            <Button x:Name="BT_Connect" Content="Connect" Margin="0,1" Width="75" Height="20" Padding="0" Click="BT_Connect_Click" />
        </DockPanel>

        <TabControl Margin="0,27,0,0" BorderThickness="0.5" BorderBrush="Gray">
            <TabItem Header="Applications">
                <Grid Background="#FFFFFF">

                    <ListView x:Name="Appene" ItemsSource="{Binding}" SelectionMode="Single"  Margin="0,10" HorizontalAlignment="Left" Width="533">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Width="380" Header="Application" DisplayMemberBinding="{Binding Name}"  />
                                <GridViewColumn Width="110" Header="Version" DisplayMemberBinding="{Binding Version}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Button x:Name="btn_search" Content="Search" HorizontalAlignment="Left" Margin="840,10,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" Height="23"/>
                    <TextBox x:Name="txt_search" HorizontalAlignment="Left" Height="23" Margin="538,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="297"/>

                    <StackPanel Height="370" Margin="538,38,10,0" VerticalAlignment="Top" >
                        <Grid>
                            <Label HorizontalAlignment="Left" Content="Check for:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <ComboBox x:Name="Oper_AppName" x:FieldModifier="public" HorizontalAlignment="Left" Margin="0,2,0,2" Width="60" IsReadOnly="True">
                                <ComboBoxItem Content="equal" IsSelected="True"/>
                                <ComboBoxItem Content="like"/>
                            </ComboBox>
                            <TextBox x:Name="AppName" Height="23" TextWrapping="Wrap" Text="{Binding ElementName=Appene, Path=SelectedItem.Name, Mode=OneWay}" Margin="65,2,0,2"/>
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Version:" Width="100" FontWeight="Bold"/>
                        </Grid>
                        <Grid>

                            <ComboBox x:Name="Oper_AppVer" HorizontalAlignment="Left" Margin="0,2,0,2" Width="60" IsReadOnly="True" IsEnabled="{Binding ElementName=appver_check, Path=IsChecked}">
                                <ComboBoxItem Content="equal" IsSelected="True"/>
                                <ComboBoxItem Content="like"/>
                            </ComboBox>
                            <TextBox x:Name="AppVersion" Height="23" TextWrapping="Wrap" Text="{Binding SelectedItem.Version, ElementName=Appene, Mode=OneWay}" IsEnabled="{Binding ElementName=appver_check, Path=IsChecked}" Margin="65,2,29,2"/>
                            <CheckBox x:Name="appver_check" Margin="0,6,7,6" IsChecked="True" HorizontalAlignment="Right" Width="17" />
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="CollectionName:" Width="103" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="AppColName" Height="23" TextWrapping="Wrap" Text="{Binding SelectedItem.ColName, ElementName=Appene, Mode=OneWay}" Margin="0,2,0,2"/>
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="QueryName:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="AppQueryName" Height="23" TextWrapping="Wrap" Margin="0,2,0,2"/>
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Comment:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="AppComment" Height="23" TextWrapping="Wrap" Margin="0,2,0,2"/>
                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Check:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <RadioButton x:Name="App_Inst" GroupName="Check" Content="Installed" Padding="0,0,10,0" HorizontalAlignment="right" Height="15" IsChecked="True"/>
                                <RadioButton x:Name="App_NotInst" GroupName="Check" Content="NotInstalled" HorizontalAlignment="right" Height="15" />
                            </StackPanel>

                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Type:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <RadioButton x:Name="App_x86" GroupName="Type" Content="x86" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" />
                                <RadioButton x:Name="App_x64" GroupName="Type" Content="x64" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" />
                                <RadioButton x:Name="App_Both" GroupName="Type" Content="Both" HorizontalAlignment="Right" Height="15" IsChecked="True" />
                            </StackPanel>
                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Update:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <CheckBox x:Name="AppSchedInc" Content="Incremental" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" IsChecked="True"  />
                                <CheckBox x:Name="AppSchedSch" Content="Scheduled" HorizontalAlignment="Right" Padding="0,0,0,0" Height="15" IsChecked="True"  />
                            </StackPanel>
                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Use:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <RadioButton x:Name="App_UseName" GroupName="use" Content="AppName" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" IsChecked="True" Checked="AppOrProduct" />
                                <RadioButton x:Name="App_UseID" GroupName="use" Content="ProductCode" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" Checked="AppOrProduct" />
                            </StackPanel>
                        </Grid>
                    </StackPanel>

                    <TextBox x:Name="AppColSearch" Height="23" Margin="538,427,0,0" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" Width="160"/>
                    <Button x:Name="btn_FindCollections" Content="Search" Margin="703,427,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" Height="23" Click="btn_FindCollections_Click"/>

                    <Button x:Name="App_Create" Content="Create" HorizontalAlignment="Left" Margin="933,427,0,0" VerticalAlignment="Top" Width="75" Height="23" Click="App_Create_Click" />

                    <ListView x:Name="AppCol" ItemsSource="{Binding}" SelectionMode="Single" Margin="538,455,0,10" HorizontalAlignment="Left" Width="470"  >
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Width="410" Header="Collection" DisplayMemberBinding="{Binding Name}"  />
                            </GridView>
                        </ListView.View>
                    </ListView>


                </Grid>
            </TabItem>
            <TabItem Header="Groups">
                <Grid Background="#FFFFFF">

                    <ListView x:Name="lst_Groups" ItemsSource="{Binding}" SelectionMode="Single"  Margin="0,10,0,10" HorizontalAlignment="Left" Width="533" >
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Width="500" Header="Group" DisplayMemberBinding="{Binding Group}"  />
                            </GridView>
                        </ListView.View>
                    </ListView>


                    <ListView x:Name="GroupCol" ItemsSource="{Binding}" SelectionMode="Single" Margin="538,455,0,10" HorizontalAlignment="Left" Width="460"  >
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Width="310" Header="Collection" DisplayMemberBinding="{Binding Name}"  />
                                <GridViewColumn Width="100" Header="Type" DisplayMemberBinding="{Binding Type}" />
                            </GridView>
                        </ListView.View>
                    </ListView>

                    <Button x:Name="Group_Create" Content="Create" HorizontalAlignment="Left" Margin="923,427,0,0" VerticalAlignment="Top" Width="75" Height="23" Click="Group_Create_Click" />

                    <TextBox x:Name="GroupSearch"  HorizontalAlignment="Left" Height="23" Margin="538,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="297"/>
                    <Button x:Name="btn_GroupSearch" Content="Search" HorizontalAlignment="Left" Margin="840,10,0,0" VerticalAlignment="Top" Width="75" Height="23" Click="btn_GroupSearch_Click"  />

                    <StackPanel Height="318" Margin="538,38,10,0" VerticalAlignment="Top" >
                        <Grid>
                            <Label HorizontalAlignment="Left" Content="Group:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <ComboBox x:Name="Oper_AppName1" x:FieldModifier="public" HorizontalAlignment="Left" Margin="0,2,0,2" Width="60" IsReadOnly="True">
                                <ComboBoxItem Content="equal" IsSelected="True"/>
                                <ComboBoxItem Content="like"/>
                            </ComboBox>
                            <TextBox x:Name="txt_Group" Height="23" TextWrapping="Wrap" Text="{Binding SelectedItem.Group, ElementName=lst_Groups, Mode=OneWay}" Margin="64,2,1,2"/>
                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="CollectionName:" Width="103" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="GroupCollName" Height="23" TextWrapping="Wrap" Text="{Binding SelectedItem.ColName, ElementName=Appene, Mode=OneWay}" Margin="0,2,0,2"/>
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="QueryName:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="GroupQueryName" Height="23" TextWrapping="Wrap" Margin="0,2,0,2"/>
                        </Grid>
                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Comment:" Width="100" FontWeight="Bold" />
                        </Grid>
                        <Grid>

                            <TextBox x:Name="GroupComment" Height="23" TextWrapping="Wrap" Margin="0,2,0,2"/>
                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Check:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <RadioButton x:Name="Group_Inst" GroupName="GCheck" Content="In Group" Padding="0,0,10,0" HorizontalAlignment="right" Height="15" IsChecked="True"/>
                            </StackPanel>

                        </Grid>

                        <Grid>
                            <Label HorizontalAlignment="Left"  Content="Update:" Width="60" FontWeight="Bold" />
                            <StackPanel Orientation="Horizontal" Margin="65,0,0,0">
                                <CheckBox x:Name="GrpSchedInc" Content="Incremental" HorizontalAlignment="Right" Padding="0,0,10,0" Height="15" IsChecked="True"  />
                                <CheckBox x:Name="GrpSchedSch" Content="Scheduled" HorizontalAlignment="Right" Padding="0,0,0,0" Height="15" IsChecked="True"  />
                            </StackPanel>
                        </Grid>


                    </StackPanel>
                    <TextBox x:Name="SearchColl" Height="23" Margin="538,427,0,0" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" Width="160"/>
                    <Button x:Name="btn_FindGroupCol" Content="Search" Margin="703,427,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" Height="23" Click="btn_FindGroupCol_Click" />



                </Grid>
            </TabItem>
        </TabControl>




    </Grid>
</Window>
